import request from '@/config/axios'

// 保费记录 VO
export interface PremiumRecordVO {
  id: number // 主键
  userId: number // 用户id
  premium: number // 保费
  status: number // 状态 0 未支付 1 已支付  2已退
  orderId: number // 订单id
}

// 保费记录 API
export const PremiumRecordApi = {
  // 查询保费记录分页
  getPremiumRecordPage: async (params: any) => {
    return await request.get({ url: `/wine/premium-record/page`, params })
  },

  // 查询保费记录详情
  getPremiumRecord: async (id: number) => {
    return await request.get({ url: `/wine/premium-record/get?id=` + id })
  },

  // 新增保费记录
  createPremiumRecord: async (data: PremiumRecordVO) => {
    return await request.post({ url: `/wine/premium-record/create`, data })
  },

  // 修改保费记录
  updatePremiumRecord: async (data: PremiumRecordVO) => {
    return await request.put({ url: `/wine/premium-record/update`, data })
  },

  // 删除保费记录
  deletePremiumRecord: async (id: number) => {
    return await request.delete({ url: `/wine/premium-record/delete?id=` + id })
  },

  // 导出保费记录 Excel
  exportPremiumRecord: async (params) => {
    return await request.download({ url: `/wine/premium-record/export-excel`, params })
  }
}